
import sys

from loguru import logger as loguru_logger


class Log:
    def __init__(self):
        self.level = "DEBUG"

    def setup_log(self):
        loguru_logger.remove()
        loguru_logger.add(sink=sys.stdout, level=self.level)

        # logger.add("my_project.log", level=level, rotation="100 MB")  # Output log messages to a file
        return loguru_logger

loggin = Log()
logger = Log().setup_log()

logger.warning("unable to retrieve model history from database, model history will be created from scratch")